package com.hethongviet.vending.helper.dialog;

import com.google.android.DemoKit.R;

import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnKeyListener;
import android.view.KeyEvent;
import android.view.Window;

public class DialogProgress
{
	private Dialog _dialog = null;

	public DialogProgress(Activity activity)
	{
		_dialog = new Dialog(activity);
		_dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
		_dialog.setContentView(R.layout.dialog_progress);
		_dialog.setOnKeyListener(new OnKeyListener() {
			
			@Override
			public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event)
			{
				if(keyCode == KeyEvent.KEYCODE_BACK)
				{
					_dialog.dismiss();
				}
				return false;
			}
		});
	}

	public void show()
	{
		_dialog.show();
	}
	public void hide()
	{
		_dialog.hide();
	}
}
